<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>03_CSS常用值</title>
    <style>
        h1{
            color: red;
            /*rgb(red,green,blue)*/
            color: rgb(255,0,0);
            color: rgb(0,255,0);
            color: rgb(0,0,255);
            color: rgb(0,0,0);
            color: rgb(255,255,255);
            /*十六进制*/
            color: #ff0000;
            color: #00ff00;
            color: #00ff;
            color: #fff;
            color: #000;
            /*带不透明度的颜色*/
            color: rgba(255,0,0,1);
            color: rgba(255,0,0,0.8);
            color: rgba(255,0,0,0.6);
            color: rgba(255,0,0,0.4);
            color: rgba(255,0,0,0.2);
            color: rgba(255,0,0,0);
        }

        .d1{
            width: 500px;
            height: 300px;
            background-image: linear-gradient(0deg,red,blue,black);
        }
        .d2{
            /*块级元素的宽度默认为父级宽度的100%，高度为0的内容撑起来*/
            width: 50px;
            height: 100px;
            /*插入背景图，注意必须设置所在区域的大小*/
            background-color: blue;
            /*背景图与背景色可以同时存在，不显示图的显示背景色*/
            background-image: url("img/mr.png");
            /*设置背景图的尺寸：宽度 高度*/
            background-size: 50px 100px;
        }
        .d3{
            width: 300px;
            height: 300px;
            border: 5px solid red;
            background-image: url("img/mr.png");
            background-repeat: no-repeat;
            background-position: 50px 50px;
            background-position: 0px 50px;
            background-position: 50px 0px;
            background-position: -50px -50px;
            background-position: left top;
            background-position: center;
            background-position: 50% 50%;
        }
    </style>
</head>
<body>
    <h1>测试颜色</h1>
    <div class="d1"></div>
    <div class="d2"></div>
    <div class="d3"></div>
</body>
</html>